//
//  WmcHomeDelegate.swift
//  YPWatermarkCamera
//
//  Created by 赵新 on 2022/4/15.
//

import UIKit
import YPGraphicEngine

// MARK: - [WmcHomeDelegate]

/// 首页代理
public protocol WmcHomeDelegate: NSObjectProtocol {
    // MARK: 导航栏

    /// 顶部导航栏返回标题
    /// - Parameters:
    ///   - attribute: 当前水印相机的属性
    ///   - isTransparent: 背景是否透明
    ///   - functionMode: 功能模式
    func navigationBackTitle(_ attribute: WmcAttribute,
                             isTransparent: Bool,
                             functionMode: WmcButtonItemType.HomeFunctionMode)
        -> String

    /// 顶部导航栏中心菜单的视图
    /// - Parameters:
    ///   - attribute: 当前水印相机的属性
    ///   - isTransparent: 背景是否透明
    ///   - functionMode: 功能模式
    func navigationCenterMenuView(_ attribute: WmcAttribute,
                                  isTransparent: Bool,
                                  functionMode: WmcButtonItemType.HomeFunctionMode)
        -> UIView?

    /// 顶部导航栏中心菜单的视图的宽度
    /// - Parameters:
    ///   - attribute: 当前水印相机的属性
    ///   - isTransparent: 背景是否透明
    ///   - functionMode: 功能模式
    func navigationCenterMenuViewWidth(_ attribute: WmcAttribute,
                                       isTransparent: Bool,
                                       functionMode: WmcButtonItemType.HomeFunctionMode)
        -> CGFloat

    /// 顶部导航栏右侧按钮列表
    /// - Parameters:
    ///   - attribute: 当前水印相机的属性
    ///   - isTransparent: 背景是否透明
    ///   - functionMode: 功能模式
    ///   - defaultList: 默认的按钮列表
    /// - Returns: 自定义设置后的按钮列表
    func navigationRightMenuList(_ attribute: WmcAttribute,
                                 isTransparent: Bool,
                                 functionMode: WmcButtonItemType.HomeFunctionMode,
                                 defaultList: [WmcButtonItemType.HomeNavigation])
        -> [WmcButtonItemType.HomeNavigation]

    // MARK: 菜单栏

    /// 顶部菜单按钮展开菜单的列表
    /// - Parameters:
    ///   - attribute: 当前水印相机的属性
    ///   - functionMode: 当前功能模式
    ///   - defaultList: 默认的按钮列表
    /// - Returns: 自定义设置后的按钮列表
    func topMenuList(_ attribute: WmcAttribute,
                     functionMode: WmcButtonItemType.HomeFunctionMode,
                     defaultList: [WmcButtonItemType.HomeTopMenu])
        -> [WmcButtonItemType.HomeTopMenu]

    // MARK: 底部工具栏

    /// 底部工具栏左侧的按钮列表设置
    /// - Parameters:
    ///   - attribute: 当前水印相机的属性
    ///   - isTransparent: 背景是否透明
    ///   - functionMode: 功能模式
    ///   - videoRecordState: 视频录制状态
    ///   - defaultList: 默认的按钮列表
    /// - Returns: 自定义设置后的按钮列表
    func toolLeftMenuList(_ attribute: WmcAttribute,
                          isTransparent: Bool,
                          functionMode: WmcButtonItemType.HomeFunctionMode,
                          videoRecordState: WmcHomeVC.VideoRecordState,
                          defaultList: [WmcButtonItemType.HomeFooter])
        -> [WmcButtonItemType.HomeFooter]

    /// 底部工具栏中间的按钮列表设置
    /// - Parameters:
    ///   - attribute: 当前水印相机的属性
    ///   - isTransparent: 背景是否透明
    ///   - functionMode: 功能模式
    ///   - videoRecordState: 视频录制状态
    ///   - defaultItem: 默认的按钮
    /// - Returns: 自定义设置后的按钮
    func toolCenterMenuItem(_ attribute: WmcAttribute,
                            isTransparent: Bool,
                            functionMode: WmcButtonItemType.HomeFunctionMode,
                            videoRecordState: WmcHomeVC.VideoRecordState,
                            defaultItem: WmcButtonItemType.HomeCenter)
        -> WmcButtonItemType.HomeCenter

    /// 底部工具栏右侧的按钮列表设置
    /// - Parameters:
    ///   - attribute: 当前水印相机的属性
    ///   - isTransparent: 背景是否透明
    ///   - functionMode: 功能模式
    ///   - videoRecordState: 视频录制状态
    ///   - defaultList: 默认的按钮列表
    /// - Returns: 自定义设置后的按钮列表
    func toolRightMenuList(_ attribute: WmcAttribute,
                           isTransparent: Bool,
                           functionMode: WmcButtonItemType.HomeFunctionMode,
                           videoRecordState: WmcHomeVC.VideoRecordState,
                           defaultList: [WmcButtonItemType.HomeFooter])
        -> [WmcButtonItemType.HomeFooter]

    /// 设置底部工具栏快门按钮底部的文案
    /// - Parameters:
    ///   - attribute: 当前水印相机的属性
    ///   - isTransparent: 背景是否透明
    ///   - functionMode: 功能模式
    ///   - videoRecordState: 视频录制状态
    /// - Returns: 富文本文案
    func toolShutterTipAttributedText(_ attribute: WmcAttribute,
                                      isTransparent: Bool,
                                      functionMode: WmcButtonItemType.HomeFunctionMode,
                                      videoRecordState: WmcHomeVC.VideoRecordState)
        -> NSAttributedString?

    /// 设置是否显示底部工具栏快门按钮顶部同步团队提示
    /// - Parameters:
    ///   - attribute: 当前水印相机的属性
    ///   - isTransparent: 背景是否透明
    ///   - functionMode: 功能模式
    ///   - videoRecordState: 视频录制状态
    /// - Returns: 富文本文案
    func toolAsyncTeamTipShow(_ attribute: WmcAttribute,
                              isTransparent: Bool,
                              functionMode: WmcButtonItemType.HomeFunctionMode,
                              videoRecordState: WmcHomeVC.VideoRecordState)
        -> Bool

    /// 相机页面底部视图
    /// - Parameter attribute: 当前水印相机的属性
    /// - Returns: footer视图
    func toolCustomView(_ attribute: WmcAttribute) -> UIView?

    /// 底部功能选项设置
    /// 目前只有【编辑、拍照、视频】
    /// 可以进行自定义添加功能模块
    /// 当只有一个功能时会自动隐藏
    /// - Parameters:
    ///   - attribute: 当前水印相机的属性
    ///   - defaultList: 默认的按钮列表
    /// - Returns: 自定义设置后的按钮列表
    func bottomFunctionList(_ attribute: WmcAttribute,
                            defaultList: [WmcButtonItemType.HomeFunctionMode])
        -> [WmcButtonItemType.HomeFunctionMode]

    /// 相机画幅比发生变化
    /// - Parameters:
    ///   - attribute: 当前水印相机的属性
    ///   - isTransparent: 背景是否透明
    ///   - functionMode: 功能模式
    ///   - ratioLevel: 相机画幅占屏幕的比率等级
    func cameraRatioLevelDidChange(_ attribute: WmcAttribute,
                                   ratioLevel: YPGESunglasses.AspectRatio.RatioLevel)

    /// 水印列表数据刷新回调
    /// - Parameters:
    ///   - attribute: 当前水印相机的属性
    ///   - list: 水印列表
    func watermarkListDidLoad(_ attribute: WmcAttribute,
                              list: [WmcWatermarkClassifyModel])

    /// 水印切换了
    /// - Parameters:
    ///   - attribute: 当前水印相机的属性
    ///   - model: 水印model
    func watermarkDidChange(_ attribute: WmcAttribute,
                            model: WmcWatermarkDetailModel)

    // MARK: 事务相关

    /// 相机旋转取向设置
    /// 可以设置为仅支持个别几个方向
    /// - Parameters:
    ///   - attribute: 当前水印相机的属性
    ///   - functionMode: 功能模式
    ///   - videoRecordState: 视频录制状态
    ///   - defaultOrientation: 默认旋转取向
    /// - Returns: 需要支持的旋转取向
    func cameraRotatingOrientation(_ attribute: WmcAttribute,
                                   functionMode: WmcButtonItemType.HomeFunctionMode,
                                   videoRecordState: WmcHomeVC.VideoRecordState,
                                   defaultOrientation: [UIDeviceOrientation])
        -> [UIDeviceOrientation]

    /// 当功能模式发生点击事件
    /// - Parameters:
    ///   - attribute: 当前水印相机的属性
    ///   - functionMode: 功能模式
    func cameraDidSelectFunctionMode(_ attribute: WmcAttribute,
                                     functionMode: WmcButtonItemType.HomeFunctionMode)

    /// 设置左下角本地相册加载的媒体类型
    /// - Parameters:
    ///   - attribute: 当前水印相机的属性
    ///   - defaultTypes: 默认加载的媒体类型
    /// - Returns: 返回需要浏览的媒体类型
    func localAlbumLoadMediaType(_ attribute: WmcAttribute,
                                 defaultMediaTypes: [WmcMedia.MediaType])
        -> [WmcMedia.MediaType]

    // MARK: 水印相关

    /// 默认水印即将加载
    /// - Parameters:
    ///   - attribute: 当前水印相机的属性
    ///   - classifyList: 水印分类列表 包含了所有的水印
    ///   - defaultWatermarkModel: 默认加载的水印
    /// - Returns: 设置需要加载的水印
    func watermarkWillLoadDefault(_ attribute: WmcAttribute,
                                  classifyList: [WmcWatermarkClassifyModel],
                                  defaultWatermarkModel: WmcWatermarkDetailModel)
        -> WmcWatermarkDetailModel

    /// 最后一次使用的水印是否需要从缓存读取
    ///
    ///             当相机重启时，会优先加载硬盘缓存的水印使用，这样即便是在无网的情况下也能正常使用
    ///             默认此值为true，如果设置为false，则每次都会从网络中台获取水印
    /// - Parameters:
    ///   - attribute: 当前水印相机的属性
    ///   - watermarkModel: 即将缓存的水印
    func watermarkLastReadToCache(_ attribute: WmcAttribute)
        -> Bool

    /// 最后一次使用的水印是否需要进入缓存
    ///
    ///             当相机重启时，会优先加载硬盘缓存的水印使用，这样即便是在无网的情况下也能正常使用
    ///             默认此值为true，如果设置为false，则改水印不会进入缓存系统，读取时每次都会从网络中台获取
    ///             可以根据不同的水印设置该值，达到每个水印使用不同的缓存体系
    /// - Parameters:
    ///   - attribute: 当前水印相机的属性
    ///   - watermarkModel: 即将缓存的水印
    func watermarkLastSaveToCache(_ attribute: WmcAttribute,
                                  watermarkModel: WmcWatermarkDetailModel)
        -> Bool

    /// 水印即将渲染
    /// - Parameters:
    ///   - attribute: 当前水印相机的属性
    ///   - watermarkModel: 即将渲染的水印模型
    func watermarkWillDraw(_ attribute: WmcAttribute,
                           watermarkModel: WmcWatermarkDetailModel)
        -> WmcWatermarkDetailModel

    /// 水印即将进行编辑
    /// 选择对于此事件进行处理的方式
    /// - Parameters:
    ///   - attribute: 当前水印相机的属性
    ///   - watermarkModel: 编辑的水印模型
    /// - Returns: 事件处理方式
    func watermarkWillEdit(_ attribute: WmcAttribute,
                           watermarkModel: WmcWatermarkDetailModel)
        -> WmcActionType

    /// 水印视图布局完成
    /// - Parameters:
    ///   - attribute: 当前水印相机的属性
    ///   - watermarkView: 水印视图
    ///   - watermarkModel: 水印模型
    func watermarkViewLayoutComplete(_ attribute: WmcAttribute,
                                     watermarkView: WmcBaseWatermarkTemplateView,
                                     watermarkModel: WmcWatermarkDetailModel)

    /// 水印是否允许移动
    /// - Parameters:
    ///   - attribute: 当前水印相机的属性
    ///   - watermarkView: 水印视图
    ///   - watermarkModel: 水印模型
    func watermarkViewIsAllowMove(_ attribute: WmcAttribute,
                                  watermarkModel: WmcWatermarkDetailModel)
        -> Bool

    /// 水印视图被移动
    /// - Parameters:
    ///   - attribute: 当前水印相机的属性
    ///   - watermarkView: 水印视图
    ///   - watermarkModel: 水印模型
    func watermarkViewMove(_ attribute: WmcAttribute,
                           watermarkView: WmcBaseWatermarkTemplateView,
                           watermarkModel: WmcWatermarkDetailModel)

    // MARK: 照片相关

    /// 即将拍照
    /// 选择对于此事件进行处理的方式
    /// - Parameters:
    ///   - attribute: 当前水印相机的属性
    ///   - watermarkModel: 当前水印模型
    /// - Returns: 事件处理方式
    func photoWillTakeAction(_ attribute: WmcAttribute,
                             watermarkModel: WmcWatermarkDetailModel)
        -> WmcActionType

    /// 图片处理后是否去手动确认预览页
    ///
    ///        默认相机设置页还有“拍照后手动确认”的选项
    ///        如果不需要该选项则需要设置:
    ///        WmcCameraSettingDelegate 的 settingFirstMenuCellList 代理方法，将其Cell选项关闭或屏蔽
    ///
    /// - Parameters:
    ///   - attribute: 当前水印相机的属性
    /// - Returns: 是否去预览页
    func photoDisposeToPreview(_ attribute: WmcAttribute,
                               watermarkModel: WmcWatermarkDetailModel)
        -> Bool

    /// 即将去预览页的事务
    ///
    ///     'photoDisposeToPreview' 设置为 true 后，此方法才会执行
    ///     可以使用此方法处理 '去预览页' 这个事务的处理方法
    /// - Parameters:
    ///   - attribute: 当前水印相机的属性
    /// - Returns: 事件处理方式
    func photoWillToPreviewAction(_ attribute: WmcAttribute,
                                  photoResult: YPWmcManager.PhotoResult)
        -> WmcActionType

    /// 照片处理完成回调
    ///
    ///     如果设置 'photoDisposeToPreview' 为 true， 且 'photoWillToPreviewAction' 为'default'
    ///     那么图片渲染处理的事务会在'WmcPhotoPreviewDelegate' 的 'photoDisposeComplete' 方法中回调，本方法不会回调
    /// - Parameters:
    ///   - attribute: 当前水印相机的属性
    ///   - photoResult: 照片结果，包含 水印照片、标准照片和水印信息
    func photoDisposeComplete(_ attribute: WmcAttribute,
                              photoResult: YPWmcManager.PhotoResult)

    // MARK: 视频相关

    /// 设置视频录制最大时长，单位分钟
    ///
    ///         时机在开始录制前调用
    /// - Parameters:
    ///   - attribute: 当前水印相机的属性
    ///   - watermarkModel: 水印
    /// - Returns: 返回时长，单位分钟
    func videoRecordMaxMinutes(_ attribute: WmcAttribute,
                               watermarkModel: WmcWatermarkDetailModel)
        -> CGFloat

    /// 设置视频录制的清晰度
    ///
    ///         时机在开始录制前调用
    /// - Parameters:
    ///   - attribute: 当前水印相机的属性
    ///   - watermarkModel: 水印
    ///   - currentArticulation: 当前的清晰度
    /// - Returns: 返回清晰度
    func videoRecordArticulation(_ attribute: WmcAttribute,
                                 watermarkModel: WmcWatermarkDetailModel,
                                 currentArticulation: YPGEVideoBuffer.Articulation)
        -> YPGEVideoBuffer.Articulation

    /// 视频录制时，时间变化的回调
    ///
    ///         时机在录制中按秒调用
    /// - Parameters:
    ///   - attribute: 当前水印相机的属性
    ///   - watermarkModel: 水印
    ///   - seconds: 录制秒数
    func videoRecordTimeChange(_ attribute: WmcAttribute,
                               watermarkModel: WmcWatermarkDetailModel,
                               seconds: Int)

    /// 视频录制时长超过上传视频时长时，是否需要弹出提示
    /// - Parameters:
    ///   - attribute: 当前水印相机的属性
    ///   - watermarkModel: 水印
    ///   - tipsType: 水印
    func videoRecordCompleteTimeOutTipsAction(_ attribute: WmcAttribute,
                                              watermarkModel: WmcWatermarkDetailModel,
                                              tipsType: WmcHomeVM.VideoTimeOutTipsType)
        -> WmcActionType

    /// 视频录制完成
    /// - Parameters:
    ///   - attribute: 当前水印相机的属性
    ///   - videoResult: 视频结果，包含 水印视频地址、水印视频封面、水印视频时长和水印信息
    ///   - breakOffType: 录制时被迫中断的原因（来电、切后台、即将没电、电量过低弹窗等）
    func videoRecordComplete(_ attribute: WmcAttribute,
                             videoResult: YPWmcManager.VideoResult,
                             breakOffType: WmcHomeVM.BreakOffType)
}

// MARK: - 驱动方法

public extension WmcHomeDelegate {
    /// 清理最后一次使用的水印的缓存
    func wmc_clearWatermarkLastCache() {
        YPWmcDrivingManager.shared.home_clearWatermarkLastCacheBlock?()
    }

    // MARK: 刷新

    /*
     驱动刷新时，需要熟悉以下概念
     首页模式有两种：
     1、拍照模式；2、视频模式

     状态有两种：
     1、拍照与准备录制/停止录制/即将录制状态；2、视频录制中状态

     以上模式和状态不可叠加，UI样式总共有3种:
     1、拍照模式；2、视频录制模式；3、视频录制中状态

     顶部菜单栏只与模式设置有关，在视频录制中状态时，菜单按钮回隐藏
     底部工具栏只与状态有关，在视频录制中状态时，需要暂停或停止操作
     底部状态栏也分为左右两个
     */

    /// 刷新顶部菜单按钮
    /// 拍照模式下按钮与视频模式按钮不同
    func wmc_reloadTopMenuItems() {
        YPWmcDrivingManager.shared.home_reloadTopMenuItemsBlock?()
    }

    /// 刷新底部工具栏左按钮
    /// 正常模式下（拍照、视频）按钮与 视频录制时 的按钮不同
    func wmc_reloadToolLeftMenuItems() {
        YPWmcDrivingManager.shared.home_reloadToolLeftMenuItemsBlock?()
    }

    /// 刷新底部工具栏右按钮
    /// 正常模式下（拍照、视频）按钮与 视频录制时 的按钮不同
    func wmc_reloadToolRightMenuItems() {
        YPWmcDrivingManager.shared.home_reloadToolRightMenuItemsBlock?()
    }

    // MARK: 通知

    /// 调用即可添加通知视图
    /// - Parameters:
    ///   - view: 自定义的通知视图
    ///   - key: 键值，一般用于移除
    func wmc_addNoticeView(_ view: UIView, key: String) {
        YPWmcDrivingManager.shared.home_addNoticeViewBlock?(view, key)
    }

    /// 调用即可移除通知视图
    /// - Parameter key: 根据添加时设置的键值来进行移除
    func wmc_removeNoticeView(with key: String) {
        YPWmcDrivingManager.shared.home_removeNoticeViewBlock?(key)
    }

    /// 替换当前水印
    /// - Parameter watermarkModel: 水印模型
    func wmc_replaceWatermark(_ watermarkModel: WmcWatermarkDetailModel) {
        YPWmcDrivingManager.shared.home_replaceWatermarkBlock?(watermarkModel)
    }

    // MARK: 事务

    /// 向相机控制视图添加提示视图
    /// - Parameters:
    ///   - key: 提示视图的键值
    ///   - view: 提示视图
    func wmc_addCameraControlTips(key: String,
                                  view: UIView)
    {
        YPWmcDrivingManager.shared.home_addCameraControlTipsBlock?(key, view)
    }

    /// 移除相机控制视图的提示视图
    /// - Parameters:
    ///   - key: 提示视图的键值
    func wmc_removeCameraControlTipsView(key: String) {
        YPWmcDrivingManager.shared.home_removeCameraControlTipsBlock?(key)
    }

    /// 移除所有相机控制视图的提示视图
    func wmc_removeAllCameraControlTipsView() {
        YPWmcDrivingManager.shared.home_removeAllCameraControlTipsBlock?()
    }

    /// 调用拍照
    func wmc_takePhotoAction() {
        YPWmcDrivingManager.shared.home_takePhotoActionBlock?()
    }
    
    /// 弹起水印列表
    func wmc_showWatermarkListAlertView() {
        YPWmcDrivingManager.shared.home_showWatermarkListActionBlock?()
    }
    
    /// 弹起物体识别水印列表
    func wmc_showObjectRecognitionAlertView() {
        YPWmcDrivingManager.shared.home_showObjectRecognitionAlertView?()
    }

    /// 切换前后置镜头
    func wmc_shotCut() {
        YPWmcDrivingManager.shared.home_shotCutActionBlock?()
    }
    
    /// 设置相机前后
    func wmc_setCameraPosition(_ position: YPGECamera.Position) {
        YPWmcDrivingManager.shared.home_setCameraPosition?(position)
    }

    /// 切换功能模式
    /// - Parameter functionMode: 功能模式
    func wmc_switchFunctionMode(_ functionMode: WmcButtonItemType.HomeFunctionMode) {
        YPWmcDrivingManager.shared.home_switchFunctionMode?(functionMode)
    }
}

// MARK: - =========================⚠️以下对接业务方无需查看或了解⚠️=========================

// MARK: 可选方法

public extension WmcHomeDelegate {
    // MARK: 导航栏

    /// 顶部导航栏返回标题
    func navigationBackTitle(_ attribute: WmcAttribute,
                             isTransparent: Bool,
                             functionMode: WmcButtonItemType.HomeFunctionMode) -> String
    {
        return "返回"
    }

    /// 顶部导航栏中心菜单的视图
    func navigationCenterMenuView(_ attribute: WmcAttribute,
                                  isTransparent: Bool,
                                  functionMode: WmcButtonItemType.HomeFunctionMode) -> UIView?
    {
        return nil
    }

    /// 顶部导航栏中心菜单的视图的宽度
    func navigationCenterMenuViewWidth(_ attribute: WmcAttribute,
                                       isTransparent: Bool,
                                       functionMode: WmcButtonItemType.HomeFunctionMode) -> CGFloat
    {
        return 120
    }

    /// 顶部导航条按钮列表
    func navigationRightMenuList(_ attribute: WmcAttribute,
                                 isTransparent: Bool,
                                 functionMode: WmcButtonItemType.HomeFunctionMode,
                                 defaultList: [WmcButtonItemType.HomeNavigation]) -> [WmcButtonItemType.HomeNavigation]
    {
        return defaultList
    }

    // MARK: 菜单栏

    /// 顶部菜单按钮展开菜单的列表
    func topMenuList(_ attribute: WmcAttribute,
                     functionMode: WmcButtonItemType.HomeFunctionMode,
                     defaultList: [WmcButtonItemType.HomeTopMenu]) -> [WmcButtonItemType.HomeTopMenu]
    {
        return defaultList
    }

    // MARK: 底部工具栏

    /// 正常模式下底部工具栏左侧的按钮列表设置
    func toolLeftMenuList(_ attribute: WmcAttribute,
                          isTransparent: Bool,
                          functionMode: WmcButtonItemType.HomeFunctionMode,
                          videoRecordState: WmcHomeVC.VideoRecordState,
                          defaultList: [WmcButtonItemType.HomeFooter]) -> [WmcButtonItemType.HomeFooter]
    {
        return defaultList
    }

    /// 底部工具栏中间的按钮列表设置
    func toolCenterMenuItem(_ attribute: WmcAttribute,
                            isTransparent: Bool,
                            functionMode: WmcButtonItemType.HomeFunctionMode,
                            videoRecordState: WmcHomeVC.VideoRecordState,
                            defaultItem: WmcButtonItemType.HomeCenter)
        -> WmcButtonItemType.HomeCenter
    {
        return defaultItem
    }

    /// 正常模式下底部工具栏右侧的按钮列表设置
    func toolRightMenuList(_ attribute: WmcAttribute,
                           isTransparent: Bool,
                           functionMode: WmcButtonItemType.HomeFunctionMode,
                           videoRecordState: WmcHomeVC.VideoRecordState,
                           defaultList: [WmcButtonItemType.HomeFooter]) -> [WmcButtonItemType.HomeFooter]
    {
        return defaultList
    }

    /// 相机页面底部视图
    func toolCustomView(_ attribute: WmcAttribute) -> UIView? {
        return nil
    }

    /// 底部功能列表设置
    func bottomFunctionList(_ attribute: WmcAttribute,
                            defaultList: [WmcButtonItemType.HomeFunctionMode]) -> [WmcButtonItemType.HomeFunctionMode]
    {
        return defaultList
    }

    /// 设置快门按钮底部的文案
    func toolShutterTipAttributedText(_ attribute: WmcAttribute,
                                      isTransparent: Bool,
                                      functionMode: WmcButtonItemType.HomeFunctionMode,
                                      videoRecordState: WmcHomeVC.VideoRecordState)
        -> NSAttributedString?
    {
        return nil
    }

    /// 设置是否显示底部工具栏快门按钮顶部同步团队提示
    func toolAsyncTeamTipShow(_ attribute: WmcAttribute,
                              isTransparent: Bool,
                              functionMode: WmcButtonItemType.HomeFunctionMode,
                              videoRecordState: WmcHomeVC.VideoRecordState) -> Bool
    {
        return true
    }

    // MARK: 事务相关

    /// 相机旋转取向设置
    func cameraRotatingOrientation(_ attribute: WmcAttribute,
                                   functionMode: WmcButtonItemType.HomeFunctionMode,
                                   videoRecordState: WmcHomeVC.VideoRecordState,
                                   defaultOrientation: [UIDeviceOrientation]) -> [UIDeviceOrientation]
    {
        return defaultOrientation
    }

    /// 当功能模式发生切换
    func cameraDidSelectFunctionMode(_ attribute: WmcAttribute,
                                     functionMode: WmcButtonItemType.HomeFunctionMode) {}

    /// 设置左下角本地相册加载的媒体类型
    func localAlbumLoadMediaType(_ attribute: WmcAttribute,
                                 defaultMediaTypes: [WmcMedia.MediaType]) -> [WmcMedia.MediaType]
    {
        return defaultMediaTypes
    }

    /// 相机画幅比发生变化
    func cameraRatioLevelDidChange(_ attribute: WmcAttribute,
                                   ratioLevel: YPGESunglasses.AspectRatio.RatioLevel) {}

    /// 水印列表数据刷新回调
    func watermarkListDidLoad(_ attribute: WmcAttribute,
                              list: [WmcWatermarkClassifyModel]) {}

    /// 水印切换了
    func watermarkDidChange(_ attribute: WmcAttribute,
                            model: WmcWatermarkDetailModel) {}

    // MARK: 水印相关

    /// 默认水印即将加载
    func watermarkWillLoadDefault(_ attribute: WmcAttribute,
                                  classifyList: [WmcWatermarkClassifyModel],
                                  defaultWatermarkModel: WmcWatermarkDetailModel)
        -> WmcWatermarkDetailModel
    {
        return defaultWatermarkModel
    }

    /// 水印是否需要从缓存读取
    func watermarkLastReadToCache(_ attribute: WmcAttribute) -> Bool {
        return true
    }

    /// 水印是否需要进入缓存
    func watermarkLastSaveToCache(_ attribute: WmcAttribute,
                                  watermarkModel: WmcWatermarkDetailModel)
        -> Bool
    {
        return true
    }

    /// 水印即将渲染
    func watermarkWillDraw(_ attribute: WmcAttribute,
                           watermarkModel: WmcWatermarkDetailModel)
        -> WmcWatermarkDetailModel
    {
        return watermarkModel
    }

    /// 水印即将进入编辑
    func watermarkWillEdit(_ attribute: WmcAttribute,
                           watermarkModel: WmcWatermarkDetailModel)
        -> WmcActionType
    {
        return .default
    }

    /// 水印视图布局完成
    func watermarkViewLayoutComplete(_ attribute: WmcAttribute,
                                     watermarkView: WmcBaseWatermarkTemplateView,
                                     watermarkModel: WmcWatermarkDetailModel) {}
    /// 水印是否允许移动
    func watermarkViewIsAllowMove(_ attribute: WmcAttribute,
                                  watermarkModel: WmcWatermarkDetailModel) -> Bool
    {
        return true
    }

    /// 水印视图被移动
    func watermarkViewMove(_ attribute: WmcAttribute,
                           watermarkView: WmcBaseWatermarkTemplateView,
                           watermarkModel: WmcWatermarkDetailModel) {}

    // MARK: 照片相关

    /// 即将拍照
    func photoWillTakeAction(_ attribute: WmcAttribute,
                             watermarkModel: WmcWatermarkDetailModel)
        -> WmcActionType
    {
        return .default
    }

    /// 图片处理后是否去手动确认预览页
    func photoDisposeToPreview(_ attribute: WmcAttribute,
                               watermarkModel: WmcWatermarkDetailModel)
        -> Bool
    {
        return true
    }

    /// 即将去预览页的事务
    func photoWillToPreviewAction(_ attribute: WmcAttribute,
                                  photoResult: YPWmcManager.PhotoResult)
        -> WmcActionType
    {
        return .default
    }

    /// 照片处理完成
    func photoDisposeComplete(_ attribute: WmcAttribute,
                              photoResult: YPWmcManager.PhotoResult) {}

    // MARK: 视频相关

    /// 设置视频录制最大时长，单位分钟
    func videoRecordMaxMinutes(_ attribute: WmcAttribute,
                               watermarkModel: WmcWatermarkDetailModel)
        -> CGFloat
    {
        return 10.0
    }

    /// 设置视频录制的清晰度
    func videoRecordArticulation(_ attribute: WmcAttribute,
                                 watermarkModel: WmcWatermarkDetailModel,
                                 currentArticulation: YPGEVideoBuffer.Articulation)
        -> YPGEVideoBuffer.Articulation
    {
        return currentArticulation
    }

    /// 视频录制时，时间变化的回调
    func videoRecordTimeChange(_ attribute: WmcAttribute,
                               watermarkModel: WmcWatermarkDetailModel,
                               seconds: Int) {}

    /// 视频录制时长超过上传视频时长时，是否需要弹出提示
    func videoRecordCompleteTimeOutTipsAction(_ attribute: WmcAttribute,
                                              watermarkModel: WmcWatermarkDetailModel,
                                              tipsType: WmcHomeVM.VideoTimeOutTipsType)
        -> WmcActionType
    {
        return .default
    }

    /// 视频录制完成
    func videoRecordComplete(_ attribute: WmcAttribute,
                             videoResult: YPWmcManager.VideoResult,
                             breakOffType: WmcHomeVM.BreakOffType) {}
}
